package com.celesea.auth.group.entity;

import com.celesea.auth.group.vo.GroupVo;
import com.celesea.framework.entity.BaseEntity;
import com.celesea.framework.util.EnvUtil;
import com.celesea.framework.vo.DictionaryVo;

import javax.persistence.Column;
import javax.persistence.Table;

@Table(name = "group_user_mapping")
public class GroupUser extends BaseEntity {

    @Column(name = "`user_id`", columnDefinition = "用户Id")
    private String userId;
    @Column(name = "`user_name`", columnDefinition = "用户名称")
    private String userName;
    @Column(name = "`group_id`", columnDefinition = "群组Id")
    private String groupId;
    @Column(name = "`group_name`", columnDefinition = "群组名称")
    private String groupName;

    public GroupUser() {
    }

    public GroupUser(GroupVo group, DictionaryVo item) {
        super.tenantId= EnvUtil.getTenantId();
        this.userId = item.getId();
        this.userName = item.getName();
        this.groupId = group.getId();
        this.groupName = group.getName();
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }
}
